 import "@scss/login.scss"
 import http from "../utils/request.js";

 $("body").on("click","#loginBtn",async function(){
    
    const userPhone=$("#userPhone").val();
    const passWord=$("#password").val();

    let mes= await http({ url: "/api/users/login", type: "post", data: {userPhone,passWord} });
  
     
     if(mes.code!=-1){
         localStorage.setItem("token",mes.token);
         localStorage.setItem("userId",mes.user);
           window.location.href="./firstPage.html";
     }else{
         alert("登录失败")
     }
  })